package com.hundsun.yr.universal.p2p.bean;


public class Bonus {

	
	
	/**
	 * 优惠类型
	 */
	public enum EnumBonusType {
		REDPACKET("REDPACKET","红包"),
		INTEGRAL("INTEGRAL","积分"),
		CASHCOUPON("CASHCOUPON","现金券"),
		OTHER("OTHER","其他");

	    /** 状态描述 **/
	    private String description;
	    /** 状态 **/
	    private String status;

	    /**
	     * 私有构造方法
	     * @param description 描述
	     **/
	    private EnumBonusType(String status,String description) {
	        this.status = status;
	        this.description = description;
	    }

	    /**
	     * 根据描述查找枚举
	     * 
	     * @param description 编码
	     * @return EnumSTATUS
	     **/
	    public static EnumBonusType find(String description) {
	        for (EnumBonusType frs : EnumBonusType.values()) {
	            if (frs.getDescription().equals(description)) {
	                return frs;
	            }
	        }
	        return null;
	    }
	    /**
	     * 根据枚举查找描述
	     * 
	     * @param status 枚举
	     * @return String
	     **/
	    public static String getDescription(String status) {
	    	for (EnumBonusType frs : EnumBonusType.values()) {
	            if (frs.status.equals(status)) {
	                return frs.description;
	            }
	        }
			return status;
	    }
	    
	    public String getDescription() {
	        return description;
	    }
	}
	
}
